package com.hwatsang.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name="user")
public class User {
	
	public static final short SMS_NOT_AUTH = 0;
	public static final short SMS_AUTH = 1;
	
	private long id;
	private String mobilePhone;
	private String password;
	private String name;
	private short gender;
	private String address;
	private String email;
	private short level;	
	private Date gmtCreate;
	private short isSuspended;
	private short smsAuthenticated = 0;
	private Date gmtLastLogin;
	private String loginKey;
	
	@Id	
	@GeneratedValue
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	
	@Column(name="mobile_phone")
	public String getMobilePhone() {
		return mobilePhone;
	}
	public void setMobilePhone(String mobilePhone) {
		this.mobilePhone = mobilePhone;
	}
	
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public short getGender() {
		return gender;
	}
	public void setGender(short gender) {
		this.gender = gender;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public short getLevel() {
		return level;
	}
	public void setLevel(short level) {
		this.level = level;
	}
	
	@Column(name="gmt_create")
	public Date getGmtCreate() {
		return gmtCreate;
	}
	public void setGmtCreate(Date gmtCreate) {
		this.gmtCreate = gmtCreate;
	}
	
	@Column(name="is_suspended")
	public short getIsSuspended() {
		return isSuspended;
	}
	public void setIsSuspended(short isSuspended) {
		this.isSuspended = isSuspended;
	}
	
	@Column(name="sms_authenticated")
	public short getSmsAuthenticated() {
		return smsAuthenticated;
	}
	public void setSmsAuthenticated(short smsAuthenticated) {
		this.smsAuthenticated = smsAuthenticated;
	}
	
	@Column(name="gmt_last_login")
	public Date getGmtLastLogin() {
		return gmtLastLogin;
	}
	public void setGmtLastLogin(Date gmtLastLogin) {
		this.gmtLastLogin = gmtLastLogin;
	}
	
	@Column(name="login_key")
	public String getLoginKey() {
		return loginKey;
	}
	public void setLoginKey(String loginKey) {
		this.loginKey = loginKey;
	}	
}
